using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._DataComparison
{
    /// <summary>
    /// <para>Table Compare</para>
    /// <para>Compares two tables or table views and returns the comparison results.</para>
    /// <para>比较两个表或表视图，并返回比较结果。</para>
    /// </summary>    
    [DisplayName("Table Compare")]
    public class TableCompare : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TableCompare()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_base_table">
        /// <para>Input Base Table</para>
        /// <para>The Input Base Table is compared with the Input Test Table. The Input Base Table refers to tabular data that you have declared valid. The base data has the correct field definitions and attribute values.</para>
        /// <para>将输入基表与输入测试表进行比较。输入基表是指已声明有效的表格数据。基础数据具有正确的字段定义和属性值。</para>
        /// </param>
        /// <param name="_in_test_table">
        /// <para>Input Test Table</para>
        /// <para>The Input Test Table is compared against the Input Base Table. The Input Test Table refers to data that you have made changes to by editing or compiling new fields, new records, or new attribute values.</para>
        /// <para>将输入测试表与输入基表进行比较。输入测试表是指通过编辑或编译新字段、新记录或新属性值而进行更改的数据。</para>
        /// </param>
        /// <param name="_sort_field">
        /// <para>Sort Field</para>
        /// <para>The field or fields used to sort records in the Input Base Table and the Input Test Table. The records are sorted in ascending order. Sorting by a common field in both the Input Base Table and the Input Test Table ensures that you are comparing the same row from each input dataset.</para>
        /// <para>用于对“输入基表”和“输入测试表”中的记录进行排序的一个或多个字段。记录按升序排序。按“输入基表”和“输入测试表”中的公共字段进行排序可确保比较每个输入数据集中的同一行。</para>
        /// </param>
        public TableCompare(object _in_base_table, object _in_test_table, object _sort_field)
        {
            this._in_base_table = _in_base_table;
            this._in_test_table = _in_test_table;
            this._sort_field = _sort_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Table Compare";

        public override string CallName => "management.TableCompare";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_base_table, _in_test_table, _sort_field, _compare_type.GetGPValue(), _ignore_options, _attribute_tolerances, _omit_field, _continue_compare.GetGPValue(), _out_compare_file, _compare_status.GetGPValue()];

        /// <summary>
        /// <para>Input Base Table</para>
        /// <para>The Input Base Table is compared with the Input Test Table. The Input Base Table refers to tabular data that you have declared valid. The base data has the correct field definitions and attribute values.</para>
        /// <para>将输入基表与输入测试表进行比较。输入基表是指已声明有效的表格数据。基础数据具有正确的字段定义和属性值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Base Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_base_table { get; set; }


        /// <summary>
        /// <para>Input Test Table</para>
        /// <para>The Input Test Table is compared against the Input Base Table. The Input Test Table refers to data that you have made changes to by editing or compiling new fields, new records, or new attribute values.</para>
        /// <para>将输入测试表与输入基表进行比较。输入测试表是指通过编辑或编译新字段、新记录或新属性值而进行更改的数据。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Test Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_test_table { get; set; }


        /// <summary>
        /// <para>Sort Field</para>
        /// <para>The field or fields used to sort records in the Input Base Table and the Input Test Table. The records are sorted in ascending order. Sorting by a common field in both the Input Base Table and the Input Test Table ensures that you are comparing the same row from each input dataset.</para>
        /// <para>用于对“输入基表”和“输入测试表”中的记录进行排序的一个或多个字段。记录按升序排序。按“输入基表”和“输入测试表”中的公共字段进行排序可确保比较每个输入数据集中的同一行。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sort Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sort_field { get; set; }


        /// <summary>
        /// <para>Compare Type</para>
        /// <para><xdoc>
        ///   <para>The comparison type. ALL is the default. The default will compare all properties of the tables being compared.</para>
        ///   <bulletList>
        ///     <bullet_item>All—Compare all properties. This is the default.</bullet_item><para/>
        ///     <bullet_item>Attributes only—Only compare the attributes and their values.</bullet_item><para/>
        ///     <bullet_item>Schema only—Only compare the schema.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>比较类型。ALL 是默认值。默认值将比较要比较的表的所有属性。</para>
        ///   <bulletList>
        ///     <bullet_item>全部 （All） - 比较所有属性。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>仅属性 - 仅比较属性及其值。</bullet_item><para/>
        ///     <bullet_item>仅方案 - 仅比较方案。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _compare_type_value _compare_type { get; set; } = _compare_type_value._ALL;

        public enum _compare_type_value
        {
            /// <summary>
            /// <para>All</para>
            /// <para>All—Compare all properties. This is the default.</para>
            /// <para>全部 （All） - 比较所有属性。这是默认设置。</para>
            /// </summary>
            [Description("All")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Attributes only</para>
            /// <para>Attributes only—Only compare the attributes and their values.</para>
            /// <para>仅属性 - 仅比较属性及其值。</para>
            /// </summary>
            [Description("Attributes only")]
            [GPEnumValue("ATTRIBUTES_ONLY")]
            _ATTRIBUTES_ONLY,

            /// <summary>
            /// <para>Schema only</para>
            /// <para>Schema only—Only compare the schema.</para>
            /// <para>仅方案 - 仅比较方案。</para>
            /// </summary>
            [Description("Schema only")]
            [GPEnumValue("SCHEMA_ONLY")]
            _SCHEMA_ONLY,

        }

        /// <summary>
        /// <para>Ignore Options</para>
        /// <para><xdoc>
        ///   <para>These properties will not be compared.</para>
        ///   <bulletList>
        ///     <bullet_item>Ignore extension properties—Do not compare extension properties.</bullet_item><para/>
        ///     <bullet_item>Ignore subtypes—Do not compare subtypes.</bullet_item><para/>
        ///     <bullet_item>Ignore relationship classes—Do not compare relationship classes.</bullet_item><para/>
        ///     <bullet_item>Ignore field alias—Do not compare field aliases.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>不会比较这些属性。</para>
        ///   <bulletList>
        ///     <bullet_item>忽略扩展属性 - 不比较扩展属性。</bullet_item><para/>
        ///     <bullet_item>忽略子类型 （Ignore subtypes） - 不比较子类型。</bullet_item><para/>
        ///     <bullet_item>忽略关系类 - 不比较关系类。</bullet_item><para/>
        ///     <bullet_item>忽略字段别名 - 不比较字段别名。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore Options")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _ignore_options { get; set; } = null;


        /// <summary>
        /// <para>Attribute Tolerance</para>
        /// <para>The numeric value that determines the range in which attribute values are considered equal. This only applies to numeric field types.</para>
        /// <para>确定将属性值视为相等的范围的数值。这仅适用于数值字段类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _attribute_tolerances { get; set; } = null;


        /// <summary>
        /// <para>Omit Fields</para>
        /// <para>The field or fields that will be omitted during comparison. The field definitions and the tabular values for these fields will be ignored.</para>
        /// <para>在比较过程中将省略的一个或多个字段。这些字段的字段定义和表格值将被忽略。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Omit Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _omit_field { get; set; } = null;


        /// <summary>
        /// <para>Continue Comparison</para>
        /// <para><xdoc>
        ///   <para>Indicates whether to compare all properties after encountering the first mismatch.
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Stop after encountering the first mismatch. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Checked—Compare other properties after encountering the first mismatch.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指示在遇到第一个不匹配后是否比较所有属性。
        ///   <bulletList>
        ///     <bullet_item>未选中 - 在遇到第一个不匹配后停止。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>选中 - 在遇到第一个不匹配后比较其他属性。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Continue Comparison")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _continue_compare_value _continue_compare { get; set; } = _continue_compare_value._false;

        public enum _continue_compare_value
        {
            /// <summary>
            /// <para>CONTINUE_COMPARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONTINUE_COMPARE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CONTINUE_COMPARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CONTINUE_COMPARE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Compare File</para>
        /// <para>This file will contain all similarities and differences between the Input Base Table and the Input Test Table. This file is a comma-delimited text file that can be viewed and used as a table in ArcGIS.</para>
        /// <para>此文件将包含输入基表和输入测试表之间的所有相似之处和不同之处。此文件是一个逗号分隔的文本文件，可在 ArcGIS 中作为表进行查看和使用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Compare File")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_compare_file { get; set; } = null;


        /// <summary>
        /// <para>Compare Status</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Compare Status")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public _compare_status_value _compare_status { get; set; }

        public enum _compare_status_value
        {
            /// <summary>
            /// <para>NO_DIFFERENCES_FOUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_DIFFERENCES_FOUND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DIFFERENCES_FOUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DIFFERENCES_FOUND")]
            [GPEnumValue("false")]
            _false,

        }

        public TableCompare SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}